<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="StatisticsDataSet" targetNamespace="http://tempuri.org/StatisticsDataSet.xsd" xmlns:mstns="http://tempuri.org/StatisticsDataSet.xsd" xmlns="http://tempuri.org/StatisticsDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="StatisticsTableAdapter" GeneratorFunctionsComponentClassName="StatisticsTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" UserFunctionsComponentName="StatisticsTableAdapter" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SocialNetworkConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="SocialNetworkConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.WLQuickApps.SocialNetwork.Data.Properties.Settings.GlobalReference.Default.SocialNetworkConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="StatisticsTableAdapter" GeneratorDataComponentClassName="StatisticsTableAdapter" Name="Statistics" UserDataComponentName="StatisticsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectType="Unknown" GenerateMethods="Get" GenerateShortCommands="False" GeneratorGetMethodName="GetStatistics" GetMethodModifier="Public" GetMethodName="GetStatistics" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetStatistics" UserSourceName="GetStatistics">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT        

(SELECT COUNT(*)
	FROM aspnet_Users
	WHERE (LastActivityDate &gt;= @startDate))
	AS ActiveUserCount,

(SELECT COUNT(*)
    FROM Album INNER JOIN BaseItem ON Album.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS AlbumCount,     

(SELECT COUNT(*)
    FROM Media INNER JOIN BaseItem ON Media.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.SubType = @audioSubType AND BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS AudioCount,    

(SELECT COUNT(*)
    FROM [Collection] INNER JOIN BaseItem ON [Collection].BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS CollectionCount,

(SELECT COUNT(*)
    FROM [Comment] 
	WHERE ([Comment].PostDateTime BETWEEN @startDate AND @endDate)) 
	AS CommentCount,

(SELECT COUNT(*) 
	FROM Event INNER JOIN BaseItem ON Event.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS EventCount,

(SELECT COUNT(*)
    FROM Media INNER JOIN BaseItem ON Media.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.SubType = @fileSubType AND BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS FileCount,

(SELECT COUNT(*) 
	FROM Friend 
	WHERE (IsConfirmed = 'true'))
	AS FriendConfirmedCount,

(SELECT COUNT(*)
	FROM Friend
	WHERE (CreateDate BETWEEN @startDate AND @endDate))
	AS FriendRequestCount,

(SELECT COUNT(*)
	FROM [Group] INNER JOIN BaseItem ON [Group].BaseItemID = BaseItem.BaseItemID
	LEFT OUTER JOIN [Event] ON [Event].BaseItemID = BaseItem.BaseItemID
	WHERE ([Event].BaseItemID IS NULL AND  (BaseItem.CreateDate BETWEEN @startDate AND @endDate)))
	AS GroupCount,

(SELECT COUNT(*)
    FROM Media INNER JOIN BaseItem ON Media.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.SubType = @pictureSubType AND BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS PictureCount,

(SELECT COUNT(*) 
	FROM  UserBaseItemRating)
	AS RatingCount,

(SELECT COUNT(*) 
	FROM Tag)
	AS TagCount,

(SELECT COUNT(*)
    FROM [Profile] INNER JOIN BaseItem ON Profile.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS UserCount,

(SELECT COUNT(*)
    FROM Media INNER JOIN BaseItem ON Media.BaseItemID = BaseItem.BaseItemID
	WHERE (BaseItem.SubType =@videoSubType AND BaseItem.CreateDate BETWEEN @startDate AND @endDate)) 
	AS VideoCount</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="startDate" ColumnName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@startDate" Precision="0" Scale="0" Size="8" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="endDate" ColumnName="" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@endDate" Precision="0" Scale="0" Size="8" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="audioSubType" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@audioSubType" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="fileSubType" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@fileSubType" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="pictureSubType" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@pictureSubType" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="videoSubType" ColumnName="" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@videoSubType" Precision="0" Scale="0" Size="50" SourceColumn="" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="AlbumCount" DataSetColumn="AlbumCount" />
              <Mapping SourceColumn="ActiveUserCount" DataSetColumn="ActiveUserCount" />
              <Mapping SourceColumn="AudioCount" DataSetColumn="AudioCount" />
              <Mapping SourceColumn="CollectionCount" DataSetColumn="CollectionCount" />
              <Mapping SourceColumn="FriendConfirmedCount" DataSetColumn="FriendConfirmedCount" />
              <Mapping SourceColumn="FriendRequestCount" DataSetColumn="FriendRequestCount" />
              <Mapping SourceColumn="PictureCount" DataSetColumn="PictureCount" />
              <Mapping SourceColumn="UserCount" DataSetColumn="UserCount" />
              <Mapping SourceColumn="VideoCount" DataSetColumn="VideoCount" />
              <Mapping SourceColumn="FileCount" DataSetColumn="FileCount" />
              <Mapping SourceColumn="EventCount" DataSetColumn="EventCount" />
              <Mapping SourceColumn="GroupCount" DataSetColumn="GroupCount" />
              <Mapping SourceColumn="CommentCount" DataSetColumn="CommentCount" />
              <Mapping SourceColumn="TagCount" DataSetColumn="TagCount" />
              <Mapping SourceColumn="RatingCount" DataSetColumn="RatingCount" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectType="Unknown" GenerateShortCommands="True" GeneratorGetMethodName="GetDataBy" GeneratorSourceName="GetBaseItemCountBySubTypeAndCreateDate" Modifier="Public" Name="GetBaseItemCountBySubTypeAndCreateDate" QueryType="Scalar" ScalarCallRetval="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetDataBy" UserSourceName="GetBaseItemCountBySubTypeAndCreateDate">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT        COUNT(*) AS Expr1
FROM            BaseItem
WHERE        (SubType = @subType) AND (CreateDate BETWEEN @startDate AND @endDate)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="subType" ColumnName="SubType" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@subType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="SubType" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="startDate" ColumnName="CreateDate" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@startDate" Precision="0" ProviderType="DateTime" Scale="0" Size="8" SourceColumn="CreateDate" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="endDate" ColumnName="CreateDate" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@endDate" Precision="0" ProviderType="DateTime" Scale="0" Size="8" SourceColumn="CreateDate" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="StatisticsDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="StatisticsDataSet" msprop:Generator_DataSetName="StatisticsDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Statistics" msprop:Generator_UserTableName="Statistics" msprop:Generator_RowDeletedName="StatisticsRowDeleted" msprop:Generator_RowChangedName="StatisticsRowChanged" msprop:Generator_RowClassName="StatisticsRow" msprop:Generator_RowChangingName="StatisticsRowChanging" msprop:Generator_RowEvArgName="StatisticsRowChangeEvent" msprop:Generator_RowEvHandlerName="StatisticsRowChangeEventHandler" msprop:Generator_TableClassName="StatisticsDataTable" msprop:Generator_TableVarName="tableStatistics" msprop:Generator_RowDeletingName="StatisticsRowDeleting" msprop:Generator_TablePropName="Statistics">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="AlbumCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="AlbumCount" msprop:Generator_ColumnPropNameInRow="AlbumCount" msprop:Generator_ColumnVarNameInTable="columnAlbumCount" msprop:Generator_ColumnPropNameInTable="AlbumCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="ActiveUserCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="ActiveUserCount" msprop:Generator_ColumnPropNameInRow="ActiveUserCount" msprop:Generator_ColumnVarNameInTable="columnActiveUserCount" msprop:Generator_ColumnPropNameInTable="ActiveUserCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="AudioCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="AudioCount" msprop:Generator_ColumnPropNameInRow="AudioCount" msprop:Generator_ColumnVarNameInTable="columnAudioCount" msprop:Generator_ColumnPropNameInTable="AudioCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="CollectionCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="CollectionCount" msprop:Generator_ColumnPropNameInRow="CollectionCount" msprop:Generator_ColumnVarNameInTable="columnCollectionCount" msprop:Generator_ColumnPropNameInTable="CollectionCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="FriendConfirmedCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="FriendConfirmedCount" msprop:Generator_ColumnPropNameInRow="FriendConfirmedCount" msprop:Generator_ColumnVarNameInTable="columnFriendConfirmedCount" msprop:Generator_ColumnPropNameInTable="FriendConfirmedCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="FriendRequestCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="FriendRequestCount" msprop:Generator_ColumnPropNameInRow="FriendRequestCount" msprop:Generator_ColumnVarNameInTable="columnFriendRequestCount" msprop:Generator_ColumnPropNameInTable="FriendRequestCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="PictureCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="PictureCount" msprop:Generator_ColumnPropNameInRow="PictureCount" msprop:Generator_ColumnVarNameInTable="columnPictureCount" msprop:Generator_ColumnPropNameInTable="PictureCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="UserCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="UserCount" msprop:Generator_ColumnPropNameInRow="UserCount" msprop:Generator_ColumnVarNameInTable="columnUserCount" msprop:Generator_ColumnPropNameInTable="UserCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="VideoCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="VideoCount" msprop:Generator_ColumnPropNameInRow="VideoCount" msprop:Generator_ColumnVarNameInTable="columnVideoCount" msprop:Generator_ColumnPropNameInTable="VideoCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="FileCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="FileCount" msprop:Generator_ColumnPropNameInRow="FileCount" msprop:Generator_ColumnVarNameInTable="columnFileCount" msprop:Generator_ColumnPropNameInTable="FileCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="EventCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="EventCount" msprop:Generator_ColumnPropNameInRow="EventCount" msprop:Generator_ColumnVarNameInTable="columnEventCount" msprop:Generator_ColumnPropNameInTable="EventCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="GroupCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="GroupCount" msprop:Generator_ColumnPropNameInRow="GroupCount" msprop:Generator_ColumnVarNameInTable="columnGroupCount" msprop:Generator_ColumnPropNameInTable="GroupCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="CommentCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="CommentCount" msprop:Generator_ColumnVarNameInTable="columnCommentCount" msprop:Generator_ColumnPropNameInRow="CommentCount" msprop:Generator_ColumnPropNameInTable="CommentCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="TagCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="TagCount" msprop:Generator_ColumnVarNameInTable="columnTagCount" msprop:Generator_ColumnPropNameInRow="TagCount" msprop:Generator_ColumnPropNameInTable="TagCountColumn" type="xs:int" minOccurs="0" />
              <xs:element name="RatingCount" msdata:ReadOnly="true" msprop:Generator_UserColumnName="RatingCount" msprop:Generator_ColumnVarNameInTable="columnRatingCount" msprop:Generator_ColumnPropNameInRow="RatingCount" msprop:Generator_ColumnPropNameInTable="RatingCountColumn" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>